unit MainUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TfrmGameListCompress = class(TForm)
    btnChooseFile: TButton;
    dlgOpen: TOpenDialog;
    dlgSave: TSaveDialog;
    procedure btnChooseFileClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmGameListCompress: TfrmGameListCompress;

implementation

uses FunctionUnit;

{$R *.dfm}

procedure TfrmGameListCompress.btnChooseFileClick(Sender: TObject);
var
  ms, ms1: TMemoryStream;
begin
  if not dlgOpen.Execute then
    Exit;

  ms := TMemoryStream.Create;
  try
    ms.LoadFromFile( dlgOpen.FileName );
    CompressStream( ms );

    if not dlgSave.Execute then
      Exit;

    ms.SaveToFile( dlgSave.FileName );
  finally
    ms.Free;
  end;

end;

end.
